import { Link, NavLink, Route } from 'react-router-dom';
import './App.css';
import Home from './Home';
import Cart from './Cart';


function App() {
  return (
    <div>
      <h3>导航区域</h3>
      <hr />
      <ul>
        <li>
          <NavLink className={isActive => isActive ? 'red' : ''} to="/home">首页</NavLink>
        </li>
        <li>
          <NavLink className={isActive => isActive ? 'red' : ''} to="/cart">购物车</NavLink>
        </li>
      </ul>
      <hr />
      <Route path="/home" component={Home} />
      <Route path="/cart" component={Cart} />
    </div>
  );
}

export default App;
